import request from '@/config/axios'

// 规则分组 VO
export interface RuleGroupVO {
  id: number // 编号
  name: string // 姓名
  version: number // 版本号
}

// 规则分组 API
export const RuleGroupApi = {
  // 查询规则分组分页
  getRuleGroupPage: async (params: any) => {
    return await request.get({ url: `/law/rule-group/page`, params })
  },
  getRuleGroupList: async (params: any) => {
    return await request.get({ url: `/law/rule-group/list`, params })
  },
  // 查询规则分组详情
  getRuleGroup: async (id: number) => {
    return await request.get({ url: `/law/rule-group/get?id=` + id })
  },

  // 新增规则分组
  createRuleGroup: async (data: RuleGroupVO) => {
    return await request.post({ url: `/law/rule-group/create`, data })
  },

  // 修改规则分组
  updateRuleGroup: async (data: RuleGroupVO) => {
    return await request.put({ url: `/law/rule-group/update`, data })
  },

  // 删除规则分组
  deleteRuleGroup: async (id: number) => {
    return await request.delete({ url: `/law/rule-group/delete?id=` + id })
  },

  // 导出规则分组 Excel
  exportRuleGroup: async (params) => {
    return await request.download({ url: `/law/rule-group/export-excel`, params })
  }
}
